<ui:composition 
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:q="http://huliqing.name/qfaces"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="/WEB-INF/template/layout_blog.xhtml"
                xmlns:c="http://java.sun.com/jsp/jstl/core">
    <ui:define name="subTabName">
        <c:set var="subTabName" value="tagList" />
    </ui:define>
    <ui:define name="menuTitle">
        <h:graphicImage url="/_res/image/star.png" height="40" styleClass="alignM"/>
        文章标签
    </ui:define>
    <ui:define name="menuContent">
        
        <h:form>
            <h:panelGrid border="0" columns="4" cellpadding="3" cellspacing="3">
                <h:outputText value="新标签" />
                <h:inputText id="tagName" value="#{tagListWe.tagName}" />
                <h:commandButton value="添加" action="#{tagListWe.add}" />
                <q:validator for="tagName" required="true" displayFlag="false" messageError="必须填写一个Tag名称" />
            </h:panelGrid>
        </h:form>

        <h:form>
            <q:scroller for="tags"
                        listener="#{tagListWe.loadData}"
                        var="tag"
                        displayJump="false" face="1"
                        pageSize="10"
                        sortFields=",name,sort">
                <h:dataTable id="tags"
                             binding="#{tagListWe.uiTags}"
                             headerClass="header"
                             width="100%"
                             border="0"
                             styleClass="alignC dotted"
                             rowClasses="row1,row2"
                             columnClasses="oper,,,"
                             cellpadding="3">
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="操作" />
                        </f:facet>
                        <h:commandLink actionListener="#{tagListWe.delete}" onclick="return confirm('#{text['p.toDelete']}');" styleClass="marginLR">
                            <h:graphicImage url="/_res/image/button-delete.gif" />
                        </h:commandLink>
                    </h:column>

                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Tag" />
                        </f:facet>
                        <h:outputText value="#{tag.name}" />
                    </h:column>

                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="排序" />
                        </f:facet>
                        <h:inputText value="#{tag.sort}" />
                    </h:column>
                </h:dataTable>
                <h:commandButton value="批量更新" action="#{tagListWe.updateAll}" styleClass="button" />
            </q:scroller>
        </h:form>
    </ui:define>
</ui:composition>